package edu.team7.las.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the t2_leavetype database table.
 * 
 */
@Entity
@Table(name="t2_leavetype")
@NamedQuery(name="T2Leavetype.findAll", query="SELECT t FROM T2Leavetype t")
public class T2Leavetype implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int idt2_LeaveType;

	private String name;

	private int NDays;

	//bi-directional many-to-one association to T5LeaveApplication
	@OneToMany(mappedBy="t2Leavetype")
	private List<T5LeaveApplication> t5LeaveApplications;

	public T2Leavetype() {
	}

	public int getIdt2_LeaveType() {
		return this.idt2_LeaveType;
	}

	public void setIdt2_LeaveType(int idt2_LeaveType) {
		this.idt2_LeaveType = idt2_LeaveType;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getNDays() {
		return this.NDays;
	}

	public void setNDays(int NDays) {
		this.NDays = NDays;
	}

	public List<T5LeaveApplication> getT5LeaveApplications() {
		return this.t5LeaveApplications;
	}

	public void setT5LeaveApplications(List<T5LeaveApplication> t5LeaveApplications) {
		this.t5LeaveApplications = t5LeaveApplications;
	}

	public T5LeaveApplication addT5LeaveApplication(T5LeaveApplication t5LeaveApplication) {
		getT5LeaveApplications().add(t5LeaveApplication);
		t5LeaveApplication.setT2Leavetype(this);

		return t5LeaveApplication;
	}

	public T5LeaveApplication removeT5LeaveApplication(T5LeaveApplication t5LeaveApplication) {
		getT5LeaveApplications().remove(t5LeaveApplication);
		t5LeaveApplication.setT2Leavetype(null);

		return t5LeaveApplication;
	}

}